package se.jocke.nbrs.ui.node;

import java.util.List;
import org.openide.nodes.ChildFactory;
import org.openide.nodes.Node;
import se.jocke.nbrs.model.RestService;
import se.jocke.nbrs.model.RestServiceGroup;

/**
 *
 * @author jocke
 */
public class RSNodeChildFactory extends ChildFactory<RestService> {

    private List<RestService> services;

    public RSNodeChildFactory(List<RestService> services) {
        this.services = services;
    }

    @Override
    protected boolean createKeys(List<RestService> list) {
        for (RestService restService : services) {
            list.add(restService);
        }
        return true;
    }

    @Override
        protected Node createNodeForKey(RestService key) {
        return new RSNode(key);
    }

}
